package it.polimi.travelDream.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;



@Entity
public class Package implements Serializable{

	/**
	 * Id is the Primary Key
	 * 
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;
	String name;
	@OneToMany
	List<Transportation> transportation;
	@OneToMany
	List<Hotel> hotel;
	@OneToMany
	List<Excursion> excursion;
	
	private static final long serialVersionUID = 1L;
	
	
	public Package() {
		super();
	}
	
	public Package(int id, String name) {
		this.id = id;
		this.name = name;
		this.transportation = new ArrayList<Transportation>();
		this.hotel = new ArrayList<Hotel>();
		this.excursion = new ArrayList<Excursion>();
	}
	
	
	public int getID(){
		return this.id;
	}
	
	
	public void setName(String name){
		this.name=name;
	}
	
	
	public String getName(){
		return this.name;
	}
	
	
	public List<Transportation> getTransportation(){
		return this.transportation;	
	}
	
	
	public void setTransportation(Transportation transp){
		this.transportation.add(transp);
		
	}

	
	public void removeTransportation(Transportation transp){
		this.transportation.remove(transp);
	}
	
	
	public List<Hotel> getHotel(){
		return this.hotel;	
	}
	
	
	public void setHotel(Hotel hotel){
		this.hotel.add(hotel);
		
	}
	
	
	public void removeHotel(Transportation hotel){
		this.hotel.remove(hotel);
	}
	
	
	public List<Excursion> getExcursion(){
		return this.excursion;	
	}
	
	
	public void setExcursion(Excursion excursion){
		this.excursion.add(excursion);
		
	}
	
	
	public void removeExcursion(Transportation excursion){
		this.excursion.remove(excursion);
	}
	
	
	
	
}
